package project.pianpian.utils;

import java.util.LinkedHashMap;
import java.util.Map;


public class PageQueryUtil extends LinkedHashMap<String, Object> {
    //当前页码
    private int page;
    //查询条件
    private String factor;

    public PageQueryUtil(Map<String, Object> params) {
        this.putAll(params);

        //分页参数
        this.page = Integer.parseInt(params.get("page").toString());
        this.factor = params.get("limit").toString();
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public String getFactor() {
        return factor;
    }

    public void setFactor(String factor) {
        this.factor = factor;
    }


    @Override
    public String toString() {
        return "PageUtil{" +
                "page=" + page +
                ", factor=" + factor +
                '}';
    }
}
